package com.dhcc.bpm.modules.content.vo;

import com.dhcc.bpm.common.docNode.ZtreeNode;
import com.dhcc.bpm.modules.content.entity.DocDirectory;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName DocDirectoryVO
 * @Description  DocDirectoryVO
 * @Author lijiacheng
 * @Date 2020/2/21 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "DocDirectoryVO对象", description = "文档目录")
public class DocDirectoryVO extends DocDirectory implements ZtreeNode {
	private static final long serialVersionUID = 1L;

	/**
	 * 节点id
	 */
	private String code;

	/**
	 * 父节点ID
	 */
	private String parentId;

	/**
	 * 子孙节点
	 */
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<ZtreeNode> children;

	@Override
	public List<ZtreeNode> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}

	/**
	 * 上级文档
	 */
	private String parentName;

	/**
	 * 文档编号
	 */
	private String no;

	/**
	 * 上级文档编号
	 */
	private String parentNo;

	/**
	 * 文档路径
	 */
	private String url;

	@JsonSerialize(using = ToStringSerializer.class,nullsUsing = NullSerializer.class)
	private Long opcPluploadId;
	private String fileRealName;
	private String fileFullPath;
}
